//
//  SpecialTableViewCell.m
//  悠狸
//
//  Created by dlios on 15-8-30.
//  Copyright (c) 2015年 Dung. All rights reserved.
//

#import "SpecialTableViewCell.h"
#import "UIImageView+WebCache.h"
#import "MyModel.h"



@interface SpecialTableViewCell()

@property (nonatomic, retain)UIImageView *imageV;
@property (nonatomic, retain)UILabel *title;
@property (nonatomic, retain)UILabel *subtitle;

@end
@implementation SpecialTableViewCell


- (void)dealloc
{
    [_title release];
    [_subtitle release];
    [_imageV release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self create];
    }
    return self;
    
}

- (void)create
{
  
    self.imageV = [[UIImageView alloc] initWithFrame:CGRectMake(15 *OffWidth, 15*OffHeight, 345*OffWidth, 175*OffHeight)];
    
    
    self.title = [[[UILabel alloc] initWithFrame:CGRectMake(0, 60*OffHeight, self.imageV.frame.size.width*OffWidth, 40*OffHeight)] autorelease];
    self.title.font = [UIFont systemFontOfSize:25];
    self.title.textColor = [UIColor whiteColor];
    self.title.textAlignment = NSTextAlignmentCenter;
    [_imageV addSubview:_title];
    
    
    UILabel *line = [[[UILabel alloc] initWithFrame:CGRectMake(100*OffWidth, 90*OffHeight, 200*OffWidth, 25*OffHeight)] autorelease];
    line.text = @"______ =  = ______";
  
    line.textColor = [UIColor whiteColor];
    [self.imageV addSubview:line];
    
    
    
    
    self.subtitle = [[[UILabel alloc] initWithFrame:CGRectMake(0, 110*OffHeight, self.imageV.frame.size.width*OffWidth, 40*OffHeight)] autorelease];
     self.subtitle.textColor = [UIColor whiteColor];
    self.subtitle.textAlignment = NSTextAlignmentCenter;
    [_imageV addSubview:_subtitle];
    
    
    [self.contentView addSubview:_imageV];
    
}
- (void)setmodel:(MyModel *)model
{
    [_imageV sd_setImageWithURL:[NSURL URLWithString:model.cover_image_url] placeholderImage:[UIImage imageNamed:@"000.jpg"]];
    self.title.text  =model.title;
    self.subtitle.text = model.subtitle;
}
@end
